package com.qf.lanzhou.blog.api.service.impl.login;

import com.qf.lanzhou.blog.api.dao.Impl.login.RoleDaoImpl;
import com.qf.lanzhou.blog.api.dao.RoleDao;
import com.qf.lanzhou.blog.api.pojo.entity.Role;
import com.qf.lanzhou.blog.api.service.GetRoleService;

import java.util.List;

/**
 * @author LEON-HE
 */
public class GetRoleServiceImpl implements GetRoleService {
    private RoleDao roleDao = new RoleDaoImpl();
    @Override
    public List<Role> getRoleList(Long userId) {
        List<Role> roles = roleDao.selectRoleByUserId(userId);
        if (roles==null){
            throw new RuntimeException("系统繁忙，请重试");
        }
        return roles;
    }
}
